fi.foyt.svg.svgdom.FNISVGGroupElementController = Class.create(fi.foyt.svg.svgdom.FNISVGElementController, {
  initialize: function($super){
  },
  moveBy: function(element, x, y){
    try {
    var matrix = FNISVGDOMUtils.getTransformToElement(element, element.viewportElement);    
    matrix = matrix.translate(x / matrix.a, y / matrix.d);
    element.setAttribute("transform", 'matrix(' + [matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f].join(' ') + ')');    
  } catch (e) {
      throw new Error("FNISVGGroupElementController::moveBy: " + e);
    }
  },
  moveTo: function(element, x, y){
    try {
    var bbox = FNISVGDOMUtils.getScreenBBox(element);  
    this.moveBy(element, x - bbox.x, y - bbox.y);
    } catch (e) {
      throw new Error("FNISVGGroupElementController::moveTo: " + e);
    }
  },
  resizeBy: function(element, scaleX, scaleY) {
    try {
    if ((scaleX != 1) && (scaleY != 1)) {
    var bbox = element.getBBox();
    var matrix = FNISVGDOMUtils.getTransformToElement(element, element.viewportElement).scaleNonUniform(scaleX, scaleY);
    var transform = 'matrix(' +[matrix.a,matrix.b,matrix.c,matrix.d,matrix.e,matrix.f] .join(',') + ')' + ' translate(' + [(bbox.x / scaleX) - bbox.x, (bbox.y / scaleY) - bbox.y] + ')';
    element.setAttribute("transform", transform);
    }
    } catch (e) {
      throw new Error("FNISVGGroupElementController::resizeBy: " + e);
    }
  },
  resizeTo: function(element, width, height){
    try {      
    var bbox = FNISVGDOMUtils.getScreenBBox(element);
    this.resizeBy(element, width / bbox.width, height / bbox.height); 
    } catch (e) {
      throw new Error("FNISVGGroupElementController::resizeTo: " + e);
    }
  },
  supports: function (operation) {
    return ((operation == fi.foyt.svg.svgdom.FNISVGElementController.OPERATION_MOVE)||(operation == fi.foyt.svg.svgdom.FNISVGElementController.OPERATION_RESIZE));
  }
});